﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;

namespace Warensoft.DataService.DBHelpers
{
    public class SqlDBHelper:DBHelper
    {
        public override System.Data.Common.DbConnection CreateConnection()
        {

            return new SqlConnection();
        }

        public override System.Data.Common.DbDataAdapter CreateDataAdapter()
        {
            return new SqlDataAdapter();
        }

        public override void AddParameter(System.Data.Common.DbCommand cmd, string key, object value)
        {
         
            (cmd as SqlCommand).Parameters.AddWithValue(key,value);
        }

        public override System.Data.Common.DbCommandBuilder CreateCommandBuilder()
        {
            return new SqlCommandBuilder();
        }

        public override System.Data.Common.DbParameter CreateParameter()
        {
            return new SqlParameter();
        }
    }
}
